const path = require('path')
module.exports = {
  productionSourceMap: false,
  css: {
    loaderOptions: {
      css: {},
      postcss: {
        plugins: [
          require('postcss-px2rem')({
            remUnit: 37.5,
          }),
        ],
      },
    },
  },
  devServer: {
    //https://api.github.com/proxyServer/======>http://localhost:8080/proxyServer/
    //pathRewrite :   '^/proxyServer' ======> ''
    //https://api.github.com/======>http://localhost:8080/proxyServer
    // proxy: {
    //   '/proxyServer': {
    //     target: 'http://www.cbda1984.com:8181/',
    //     changeOrigin: true,
    //     secure: true, //https
    //     pathRewrite: {
    //       '^/proxyServer': '',
    //     },
    //   },
    // },
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        path.resolve(__dirname, 'src/assets/less/flex.less'),
        path.resolve(__dirname, 'src/assets/less/reset.less'),
      ], // 引入全局样式变量
    },
  },
}
